<%@ Page EnableEventValidation="False" Title="Search for Delivery" Language="C#" MasterPageFile="~/Pages/user/userMaster.Master" AutoEventWireup="true" CodeBehind="SearchDelivery.aspx.cs" Inherits="WarehouseWebAPP.Pages.user.Search_Pages.SearchDelivery" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style22
        {
            width: 156px;
        }
        .style23
        {
            width: 58px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style1" style="width: 100%; margin-right: 0px;">
        <tr>
            <td class="style22">
                <asp:Label ID="Label3" runat="server" Text="Component"></asp:Label>
            </td>
            <td class="style23">
                <cc1:ComboBox ID="ComponentComboBox" runat="server" AppendDataBoundItems="True" 
                    AutoCompleteMode="Append" DataSourceID="ComponentObjectDataSource" 
                    DataTextField="component_serial_num" DataValueField="component_num" 
                    DropDownStyle="DropDownList" MaxLength="0" 
                    ondatabound="ComponentComboBox_DataBound" style="display: inline;">
                </cc1:ComboBox>
            </td>
            <td>
                <asp:Label ID="Label4" runat="server" Text="User"></asp:Label>
            </td>
            <td>
                <cc1:ComboBox ID="UserComboBox" runat="server" AppendDataBoundItems="True" 
                    AutoCompleteMode="Append" DataSourceID="UserObjectDataSource" 
                    DataTextField="user_name" DataValueField="user_num" 
                    DropDownStyle="DropDownList" MaxLength="0" ondatabound="UserComboBox_DataBound" 
                    style="display: inline;">
                </cc1:ComboBox>
            </td>
        </tr>
        <tr>
            <td class="style22">
                <asp:Label ID="Label5" runat="server" Text="Customer"></asp:Label>
            </td>
            <td class="style23">
                <cc1:ComboBox ID="CustomerComboBox" runat="server" AppendDataBoundItems="True" 
                    AutoCompleteMode="Append" DataSourceID="CustomerObjectDataSource" 
                    DataTextField="customer_name" DataValueField="customer_num" 
                    DropDownStyle="DropDownList" MaxLength="0" 
                    ondatabound="CustomerComboBox_DataBound" style="display: inline;">
                </cc1:ComboBox>
            </td>
            <td>
               </td>
            <td>
             </td>
        </tr>
        <tr>
            <td class="style22">
                <asp:Label ID="Label6" runat="server" Text="From"></asp:Label>
            </td>
            <td class="style23">
                <asp:TextBox ID="FromTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="FromTextBox_MaskedEditExtender" runat="server" 
                    Mask="99/99/9999" MaskType="Date" TargetControlID="FromTextBox" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="FromTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="FromTextBox">
                </cc1:CalendarExtender>
            </td>
            <td colspan="1">
                <asp:Label ID="Label7" runat="server" Text="To"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="ToTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="ToTextBox_MaskedEditExtender" runat="server" 
                    TargetControlID="ToTextBox" Mask="99/99/9999" MaskType="Date" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="ToTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="ToTextBox">
                </cc1:CalendarExtender>

            </td>
        </tr>
        <tr>
            <td bgcolor="#E3E6EA" colspan="3">
                &nbsp;</td>
            <td bgcolor="#E3E6EA">
            <asp:Button ID="Button1" runat="server" BackColor="#FFFBFF" 
 BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"  
 Font-Names="Verdana" Font-Size="Small" ForeColor="#284775" Text="Search" Width="76px" 
                    onclick="Button1_Click"/>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="DeliveryGridView" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="4" 
                    DataKeyNames="delivered_num" DataSourceID="DeliveredObjectDataSource" 
                    ForeColor="#333333" GridLines="None" 
                    ondatabound="DeliveryGridView_DataBound" 
    AllowSorting="True" Width="661px">
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <Columns>
                                <asp:BoundField DataField="delivered_num" HeaderText="delivered_num" 
                            ReadOnly="True" SortExpression="delivered_num" Visible="False" />
                                <asp:TemplateField HeaderText="Component" 
                            SortExpression="delivered_component">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" 
                                    Text='<%# Bind("delivered_component") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="ComponentLabel" runat="server" 
                                    Text='<%# Bind("delivered_component") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="User" SortExpression="delivered_user">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("delivered_user") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="UserLabel" runat="server" Text='<%# Bind("delivered_user") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Customer" 
                            SortExpression="delivered_customer">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" 
                                    Text='<%# Bind("delivered_customer") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="CustomerLabel" runat="server" 
                                    Text='<%# Bind("delivered_customer") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="delivered_date" HeaderText="Delivery Date" 
                            SortExpression="delivered_date" />
                                <asp:BoundField DataField="delivered_quantity" HeaderText="Delivered Quantity" 
                            SortExpression="delivered_quantity" />
                            </Columns>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                                HorizontalAlign="Left" />
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:LinkButton ID="ExcelButton" runat="server" onclick="ExcelButton_Click">Export 
                to Excel</asp:LinkButton>
                <asp:ObjectDataSource ID="DeliveredObjectDataSource" runat="server" 
                    SelectMethod="DeliveredSearch" 
                    TypeName="WarehouseWebAPP.code.BLL.DeliveredBLL" 
                    OldValuesParameterFormatString="original_{0}">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ComponentComboBox" DefaultValue="%" 
                            Name="delivered_component" PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="UserComboBox" DefaultValue="%" 
                            Name="delivered_user" PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="CustomerComboBox" DefaultValue="%" 
                            Name="delivered_customer" PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="FromTextBox" DefaultValue="1/1/1753"
                            Name="delivered_date_from" PropertyName="Text" Type="DateTime" />
                        <asp:ControlParameter ControlID="ToTextBox" DefaultValue="1/1/2200" 
                            Name="delivered_date_to" PropertyName="Text" Type="DateTime" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="ComponentObjectDataSource" runat="server" 
                    SelectMethod="ComponentGetData" 
                    TypeName="WarehouseWebAPP.code.BLL.ComponentBLL"></asp:ObjectDataSource>
                <asp:ObjectDataSource ID="CustomerObjectDataSource" runat="server" 
                    SelectMethod="CustomerGet" TypeName="WarehouseWebAPP.code.BLL.CustomerBLL">
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="UserObjectDataSource" runat="server" 
                    SelectMethod="userGet" TypeName="WarehouseWebAPP.code.BLL.UserBLL">
                </asp:ObjectDataSource>
            </td>
        </tr>
        </table>
</asp:Content>
